/***
 * * PROJECT
 * *    ATaG
 * * VERSION
 * *    $Revision: 1.2 $
 * * DATE
 * *    $Date: 2006/10/19 21:21:52 $
 * * LOG
 * *    $Log: ATaGNodeLocation.java,v $
 * *    Revision 1.2  2006/10/19 21:21:52  lmottola
 * *    Added CVS preamble.
 * *
 * *
 * *   ATaG (Abstract Task Graph) - Data-driven Macroprogramming for
 * *                                Sensor Networks
 * *
 * *   This program is free software; you can redistribute it and/or
 * *   modify it under the terms of the GNU General Public License
 * *   as published by the Free Software Foundation; either version 2
 * *   of the License, or (at your option) any later version.
 * *
 * *   This program is distributed in the hope that it will be useful,
 * *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 * *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * *   GNU General Public License for more details.
 * *
 * *   You should have received a copy of the GNU General Public License
 * *   along with this program; if not, you may find a copy at the FSF web
 * *   site at 'www.gnu.org' or 'www.fsf.org', or you may write to the
 * *   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * *   Boston, MA  02111-1307, USA
 ***/

package atag.common;

/**
 * The class for the node location.
 * Maybe later, the coordinates themselves should be cast [from float or int or whatever]
 * @author Animesh
 */
public class ATaGNodeLocation implements Cloneable{
    
   /**
    *X coordinate
    */
    float x; 
    /**
     * Y coordinate
     */
    float y; 
    
    
    /**
     * Creates a new instance of NodeLocation
     */
    public ATaGNodeLocation() {
    }
    
    
    /**
     * Creates a new instance of NodeLocation
     */
    public ATaGNodeLocation(float argX, float argY) {
        x = argX;
        y = argY;
    }
    
    /**
     * Set the value of X
     */
    public void setX(float argX){
        x = argX;
    }
    
    
    /**
     * Set the value of Y
     */
    public void setY(float argY){
        y = argY;
    }
    
     /**
     * Gets the value of X
     */
    public float getX(){
        return x;
    }

    /**
     * Gets the value of Y
     */
    public float getY(){
        return y;
    }

    
    public ATaGNodeLocation clone() {
        Object returnobject = null;
        try {
            returnobject = super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return (ATaGNodeLocation)returnobject;
    }
    
    public boolean equals(ATaGNodeLocation arg_location){
        return ((this.getX() == arg_location.getX()) &&
                (this.getY() == arg_location.getY()));
    }

	public int hashCode() {
		int hash = 65;
		hash *= x;
		hash += y;
		return hash;
	}
    
}
